package com.atguigu.boot;

import ch.qos.logback.core.db.DBHelper;
import ch.qos.logback.core.net.SyslogOutputStream;
import com.atguigu.boot.bean.Pet;
import com.atguigu.boot.bean.User;
import com.atguigu.boot.config.MyBanner;
import com.atguigu.boot.config.MyConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @Author: LDeng
 * @Date: 2021-07-09 11:45
 */

//@SpringBootApplication
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
public class MainApplication {

    public static void main(String[] args) {

        SpringApplication springApplication = new SpringApplication(MainApplication.class);
        springApplication.setBanner(new MyBanner());
        springApplication.run(args);
//        ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);
//        MyConfig bean = run.getBean(MyConfig.class);
//
//
//        boolean tom = run.containsBean("tom");
//        System.out.println(tom);
//
//        boolean user01 = run.containsBean("user01");
//        //User user011 = run.getBean("user01", User.class);
//        System.out.println(user01);
//        //System.out.println(user011);
//        System.out.println(run.containsBean("haha"));
    }
}
